package dao.jpa;

import java.util.List;

import vo.SourceCategory;
import dao.SourceCategoryDAO;

public class SourceCategoryDAOJpaImpl extends GenericDaoJpaImpl<SourceCategory, Long> implements SourceCategoryDAO {

	public SourceCategoryDAOJpaImpl() {
		super(SourceCategory.class);
	}

	public List<SourceCategory> findAll() {
		return super.executeFinder("SourceCategory.findAll");
	}

	public List<SourceCategory> findByName(String name) {
		return super.executeFinder("SourceCategory.findByName",name);
	}

	public List<SourceCategory> findAll(int start, int pageSize) {
		return super.executeFinderPage("SourceCategory.findAll", start, pageSize);
	}

	public long findTotalCount() {
		return super.executeFinderCount("SourceCategory.findTotalCount");
	}


	public SourceCategory getById(long id) {
		return super.read(id);
	}
	public SourceCategory findByNameSourceId(String name,long sourceId) {
		return super.executeSingleFinder("SourceCategory.findByNameSourceId",name,sourceId);
	}

	public void update(long id) {
		SourceCategory sourceCategory = super.read(id);
		super.update(sourceCategory);
	}

	public void delete(long id)// 真正删除删除
	{
		SourceCategory sourceCategory = super.read(id);
		super.delete(sourceCategory);
	}

}
